﻿namespace KuiHuaBaoDian.Services.Battle.Behaviour {

    /// <summary>
    /// 战斗行为类型
    /// </summary>
    public readonly struct BattleBehaviourType {

        public static readonly BattleBehaviourType Unknown = default;
        public static readonly BattleBehaviourType Idle = new() { Value = 1 };
        public static readonly BattleBehaviourType Hold = new() { Value = 2 };
        public static readonly BattleBehaviourType Fly = new() { Value = 3 };
        public static readonly BattleBehaviourType Attack = new() { Value = 4 };
        public static readonly BattleBehaviourType Hit = new() { Value = 5 };
        public static readonly BattleBehaviourType Death = new() { Value = 6 };

        /// <summary>
        /// 值
        /// </summary>
        public int Value { get; init; }

        public override bool Equals(object obj) {
            if (obj is BattleBehaviourType other) {
                return other.Value == Value;
            }
            return false;
        }

        public override int GetHashCode() {
            return Value.GetHashCode();
        }

        public static bool operator ==(BattleBehaviourType left, BattleBehaviourType right) => left.Equals(right);
        public static bool operator !=(BattleBehaviourType left, BattleBehaviourType right) => !left.Equals(right);
    }
}
